package com.liaozl.sca.user.feign;

import com.liaozl.sca.common.constants.ServiceNames;
import com.liaozl.sca.common.dto.Result;
import com.liaozl.sca.user.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description:
 * @version: v1.0.0
 * @author: liaozuliang
 * @date: 2021/9/17 17:07
 */
@FeignClient(ServiceNames.USER_WEB)
public interface UserFeign {

    @PostMapping("/user/insert")
    Result<Boolean> insert(@RequestBody UserDTO userDTO);

    @PostMapping("/user/delete")
    Result<Boolean> delete(@RequestParam("userId") Long userId);

    @PostMapping("/user/update")
    Result<Boolean> update(@RequestBody UserDTO userDTO);

    @GetMapping("/user/getByUserId/{userId}")
    Result<UserDTO> getByUserId(@PathVariable("userId") Long userId);
}
